Open
Conversation
This commit creates a flake.nix file defining a minimal build
environment for Nix users. If you have Nix, you can run
nix develop
to enter a FHS-compliant environment with Python 3.10, 3.11, 3.12,
3.13, and 3.14 installed, along with development tools like tox and
pre-commit. From here, ordinary commands like
tox -e linting,py310,py311,py312,py313,py314
work as expected.
Note that this environment does not provide any Python packages except
tox; all dependencies are installed via tox as if we were not using
Nix.
3b9aaed to
7db658b
Compare
webknjaz
requested changes
Mar 3, 2026
Member
webknjaz
left a comment
There was a problem hiding this comment.
I think this doesn't belong upstream as having it implies an unreasonable amount of maintenance burden for the maintainers. It usually makes sense to maintain what's in the CI and in the expected dev env, which is tox — allowing us to reduce said burdens by using a workflow tool that makes the CI configuration as close as possible to the dev env.
| @@ -0,0 +1,70 @@ | |||
| { | |||
| description = "Development environment for Pytest"; | |||
Member
There was a problem hiding this comment.
We should note that this is a convenience for and by nix users and not maintained by pytest core
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This commit creates a flake.nix file defining a minimal build environment for Nix users. If you have Nix installed, you can run
to enter an environment where
work as expected.
Details
This change does not impose any changes on existing workflows; it is intended only to make it easier for Nix users to contribute to
pytest.For those Nix users, this change does not even package
pytestas a Nix derivation; instead, it provides a minimal build environment that behaves like an "ordinary" Python environment, albeit one with allpytest-supported versions of Python installed.Testing
The commands
followed by
passes.
Closes #14250.